#!/bin/bash
#########在controller2节点安装配置
# 安装nova控制节点
yum install -y openstack-nova-api openstack-nova-conductor \
  openstack-nova-console openstack-nova-novncproxy \
  openstack-nova-scheduler openstack-nova-placement-api

#同步controller1配置并修改
rsync -avzP -e 'ssh -p 22' controller1:/etc/nova/* /etc/nova/
rsync -avzP -e 'ssh -p 22' controller1:/etc/httpd/conf.d/00-nova-placement-api.conf /etc/httpd/conf.d/
rsync -avzP -e 'ssh -p 22' controller1:/etc/haproxy/* /etc/haproxy/
sleep 10
sed -i '1,9s/controller1/controller2/' /etc/nova/nova.conf


#开机自启动,启动服务nova服务 ，同上
#重启服务
systemctl restart httpd haproxy

netstat -antp|grep haproxy

netstat -antp|egrep '8774|8778|6080|8775|9778'

#开机自启动
 systemctl enable openstack-nova-api.service \
  openstack-nova-consoleauth.service openstack-nova-scheduler.service \
  openstack-nova-conductor.service openstack-nova-novncproxy.service
#启动服务
systemctl restart openstack-nova-api.service \
  openstack-nova-consoleauth.service openstack-nova-scheduler.service \
  openstack-nova-conductor.service openstack-nova-novncproxy.service

systemctl status openstack-nova-api.service \
  openstack-nova-consoleauth.service openstack-nova-scheduler.service \
  openstack-nova-conductor.service openstack-nova-novncproxy.service

source ~/admin-openstack.sh || { echo "加载前面设置的admin-openstack.sh环境变量脚本";exit; }
#查看节点
#nova service-list 
openstack catalog list
nova-status upgrade check
openstack compute service list
